MList – A text list with an attached titled panel.


Creation: MList_New(caption$, sortmode, x, y, pixelwidth, pixelheight)


caption$ - List title caption text.

sortmode – Automatic sorting mode. 0=none; 1=Alphabetic; 2=Reverse Alphabetic

Watch out with automatic sorting as large lists will take forever to populate. Use manual sort instead.

x – Pixel X coordinate for the top left corner of the list.

y – Pixel Y coordinate for the top left corner of the list.

pixelwidth – The width of the list in pixels.

pixelheight – The height of the list in pixels.


Functions:

MList_AddItem(index, text$, referencekey)

Adds a text string to the list. Optional unique reference key number. 0; some unique number.


MList_Clear(index)

Clears the entire list of contents.


MList_ClearSelected(index)

Deselects the currently selected list item.


MList_Condense(index, mode)

Condenses list removing empty entries. Mode=0, empty text. Mode=1, zero reference key.


MList_Delete(index)

Deletes the list.


MList_Disable(index)

Disables the list. Prevents user input changes.


MList_Draw(index)

Draws the list to screen.


MList_Enable(index)

Enables the list. Restores user input changes.


Mlist_Find(index, text$)

Returns list-index of given string if string is stored in list.


Mlist_FindKey(index, referencekey)

Returns list-index of given reference key if it is stored in list.


MList_GetCount(index)

Returns the number of items in the list.


MList_GetSelected(index)

Returns string, the text of item selected in the list.


MList_GetSelectedIndex(index)

Returns the list index of item selected in the list.


MList_GetSelectedKey(index)

Returns the list reference key of item selected in the list.


MList_RemoveIndex(index, arrayIndex)

Removes item using literal array index within list. arrayIndex changes if list is sorted. (Fastest)

Returns whether successful 0=no; 1=item removed.


MList_RemoveItem(index, text$)

Removes item using a matching string. Not effective if list contains string more than once.

Returns whether successful 0=no; 1=item removed.


MList_RemoveKey(index, referencekey)

Removes item using unique reference key within list. Most reliable method.

Returns whether successful 0=no; 1=item removed.


MList_SetCaption(index, caption$)

Sets the title text of the list.


MList_SetSelected(index, list-index)

Sets the selected item of the list.


MList_SetSelectedKey(index, referencekey)

Sets the selected item of the list to item matching given reference key.


MList_Sort(index)

Sorts the list alphabetically.


MList_SortReverse(index)

Sorts the list reverse alphabetically.